package responseModels

type CodeMessage struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

func (receiver *CodeMessage) IsLoginErr(msg string) CodeMessage {
	receiver.Code = 101
	receiver.Message = msg
	return CodeMessage{
		receiver.Code,
		receiver.Message,
	}
}

func (receiver *CodeMessage) FORBIDDEN(msg string) CodeMessage {
	receiver.Code = 3001
	receiver.Message = msg
	return CodeMessage{
		receiver.Code,
		receiver.Message,
	}
}

func (receiver *CodeMessage) ISVALIDATED(msg string) CodeMessage {
	receiver.Code = 4001
	receiver.Message = msg
	return CodeMessage{
		receiver.Code,
		receiver.Message,
	}
}

func (receiver *CodeMessage) Default() CodeMessage {
	receiver.Code = 71
	receiver.Message = "Message"
	return CodeMessage{
		receiver.Code,
		receiver.Message,
	}
}
func (receiver *CodeMessage) OK() CodeMessage {
	receiver.Code = 200
	receiver.Message = "操作成功!"
	return CodeMessage{
		receiver.Code,
		receiver.Message,
	}
}
func (receiver *CodeMessage) ERROR() CodeMessage {
	receiver.Code = -1
	receiver.Message = "系统繁忙!稍后再试..."
	return CodeMessage{
		receiver.Code,
		receiver.Message,
	}
}
func (receiver *CodeMessage) DEVELOP() CodeMessage {
	receiver.Code = 5001
	receiver.Message = "接口开发中..."
	return CodeMessage{
		receiver.Code,
		receiver.Message,
	}
}
